﻿----------------------------------------------------------------------------------------------------
--
--  © 2012 Stanislav S. Yarmonov.
--
--  TODO:LICENSE
--     
----------------------------------------------------------------------------------------------------
CREATE TABLE [_DB].[Translit] (
	-- Source char to be transliterated.
	[Char] [binary](2) NOT NULL,

	-- Transliterated chars.
	[Translit] [varchar](4) NOT NULL
)
GO

-- Primary key -------------------------------------------------------------------------------------
ALTER TABLE
	[_DB].[Translit]
ADD CONSTRAINT
	[PK_DB_Translit]
PRIMARY KEY CLUSTERED (
	[Char] ASC
)
GO

SET NOCOUNT ON
GO

INSERT INTO
	[_DB].[Translit]
SELECT TOP 0
	NULL AS [Char],
	NULL AS [Translit]

	-- Russian -------------------------------------------------------------------------------------
UNION ALL SELECT CONVERT([binary](2), N'а'), 'a'
UNION ALL SELECT CONVERT([binary](2), N'б'), 'b'
UNION ALL SELECT CONVERT([binary](2), N'в'), 'v'
UNION ALL SELECT CONVERT([binary](2), N'г'), 'g'
UNION ALL SELECT CONVERT([binary](2), N'д'), 'd'
UNION ALL SELECT CONVERT([binary](2), N'е'), 'e'
UNION ALL SELECT CONVERT([binary](2), N'ё'), 'e'
UNION ALL SELECT CONVERT([binary](2), N'ж'), 'j'
UNION ALL SELECT CONVERT([binary](2), N'з'), 'z'
UNION ALL SELECT CONVERT([binary](2), N'и'), 'i'
UNION ALL SELECT CONVERT([binary](2), N'й'), 'y'
UNION ALL SELECT CONVERT([binary](2), N'к'), 'k'
UNION ALL SELECT CONVERT([binary](2), N'л'), 'l'
UNION ALL SELECT CONVERT([binary](2), N'м'), 'm'
UNION ALL SELECT CONVERT([binary](2), N'н'), 'n'
UNION ALL SELECT CONVERT([binary](2), N'о'), 'o'
UNION ALL SELECT CONVERT([binary](2), N'п'), 'p'
UNION ALL SELECT CONVERT([binary](2), N'р'), 'r'
UNION ALL SELECT CONVERT([binary](2), N'с'), 's'
UNION ALL SELECT CONVERT([binary](2), N'т'), 't'
UNION ALL SELECT CONVERT([binary](2), N'у'), 'u'
UNION ALL SELECT CONVERT([binary](2), N'ф'), 'f'
UNION ALL SELECT CONVERT([binary](2), N'х'), 'h'
UNION ALL SELECT CONVERT([binary](2), N'ц'), 'c'
UNION ALL SELECT CONVERT([binary](2), N'ч'), 'ch'
UNION ALL SELECT CONVERT([binary](2), N'ш'), 'sh'
UNION ALL SELECT CONVERT([binary](2), N'щ'), 'shh'
UNION ALL SELECT CONVERT([binary](2), N'ь'), ''
UNION ALL SELECT CONVERT([binary](2), N'ы'), 'y'
UNION ALL SELECT CONVERT([binary](2), N'ъ'), ''
UNION ALL SELECT CONVERT([binary](2), N'э'), 'e'
UNION ALL SELECT CONVERT([binary](2), N'ю'), 'u'
UNION ALL SELECT CONVERT([binary](2), N'я'), 'ya'

UNION ALL SELECT CONVERT([binary](2), N'А'), 'A'
UNION ALL SELECT CONVERT([binary](2), N'Б'), 'B'
UNION ALL SELECT CONVERT([binary](2), N'В'), 'V'
UNION ALL SELECT CONVERT([binary](2), N'Г'), 'G'
UNION ALL SELECT CONVERT([binary](2), N'Д'), 'F'
UNION ALL SELECT CONVERT([binary](2), N'Е'), 'E'
UNION ALL SELECT CONVERT([binary](2), N'Ё'), 'E'
UNION ALL SELECT CONVERT([binary](2), N'Ж'), 'J'
UNION ALL SELECT CONVERT([binary](2), N'З'), 'Z'
UNION ALL SELECT CONVERT([binary](2), N'И'), 'I'
UNION ALL SELECT CONVERT([binary](2), N'Й'), 'Y'
UNION ALL SELECT CONVERT([binary](2), N'К'), 'K'
UNION ALL SELECT CONVERT([binary](2), N'Л'), 'L'
UNION ALL SELECT CONVERT([binary](2), N'М'), 'M'
UNION ALL SELECT CONVERT([binary](2), N'Н'), 'N'
UNION ALL SELECT CONVERT([binary](2), N'О'), 'O'
UNION ALL SELECT CONVERT([binary](2), N'П'), 'P'
UNION ALL SELECT CONVERT([binary](2), N'Р'), 'R'
UNION ALL SELECT CONVERT([binary](2), N'С'), 'S'
UNION ALL SELECT CONVERT([binary](2), N'Т'), 'T'
UNION ALL SELECT CONVERT([binary](2), N'У'), 'U'
UNION ALL SELECT CONVERT([binary](2), N'Ф'), 'F'
UNION ALL SELECT CONVERT([binary](2), N'Х'), 'H'
UNION ALL SELECT CONVERT([binary](2), N'Ц'), 'C'
UNION ALL SELECT CONVERT([binary](2), N'Ч'), 'Ch'
UNION ALL SELECT CONVERT([binary](2), N'Ш'), 'Sh'
UNION ALL SELECT CONVERT([binary](2), N'Щ'), 'Shh'
UNION ALL SELECT CONVERT([binary](2), N'Ь'), ''
UNION ALL SELECT CONVERT([binary](2), N'Ы'), 'Y'
UNION ALL SELECT CONVERT([binary](2), N'Ъ'), ''
UNION ALL SELECT CONVERT([binary](2), N'Э'), 'E'
UNION ALL SELECT CONVERT([binary](2), N'Ю'), 'U'
UNION ALL SELECT CONVERT([binary](2), N'Я'), 'Ya'
GO

SET NOCOUNT OFF
GO
